<%-- 
    Document   : listusersales
    Created on : Oct 8, 2012, 1:37:24 PM
    Author     : Ahsan
--%>


<%@page import="ca.trader.beans.java.UserLookupBean"%>
<%@page contentType="text/html" %>
<%@page import="ca.trader.utils.UIUtils"%>
<%@page import="ca.trader.utils.HttpConsts"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<jsp:useBean id="user" class="ca.trader.beans.java.UserLookupBean" scope="request" />

<c:choose>
    <c:when test="${empty param.id}" >

	<%
		    user.setSession(session);
	%>
    </c:when>
    <c:otherwise>

	<jsp:setProperty name="user" property="userId" param="id"/>

    </c:otherwise>
</c:choose>
<!DOCTYPE html>
<html>
    <head>
	<jsp:include page="head.jsp" />
    </head>
    <body>
	<div id="viewprofile">
	    <c:choose>
		<c:when test="${!user.userExistent}">
		    User not found.
		</c:when>
		<c:otherwise>
		    <c:out value="${user.firstName} ${user.lastName}" /><br/>
		    <c:out value="${user.email}" /><br/>
		    <c:out value="${user.city}, ${user.region},  ${user.country}" /><br/><br/>
		    
		    <a href="<%= HttpConsts.VIEW_USER_SALES_JSP_PAGE + "?page=1&id=" + user.getUserId() %>">View sales</a>
		</c:otherwise>
	    </c:choose>
	</div>

	<jsp:include page="footer.jsp" />
    </body>
</html>
